<script>
    function loadJs(url, callback) {
        var script = document.createElement('script');
        script.type = "text/javascript";
        if (typeof (callback) != "undefined") {
            if (script.readyState) {
                script.onreadystatechange = function () {
                    if (script.readyState == "loaded" || script.readyState == "complete") {
                        script.onreadystatechange = null;
                        callback();
                    }
                }
            } else {
                script.onload = function () {
                    callback();
                }
            }
        }
        script.src = url;
        document.body.appendChild(script);
    }

    function show_qrcode(data) {
        // 生成二维码
        loadJs("https://cdn.staticfile.org/jquery/2.2.4/jquery.min.js", function () {
            loadJs("https://cdn.staticfile.org/jquery.qrcode/1.0/jquery.qrcode.min.js", function () {
                jQuery('#' + data.id).qrcode({
                    text: data.src,
                    render: "table",
                    width: data.width, //设置宽度    
                    height: data.height, //设置高度   
                    typeNumber: -1, //计算模式  
                    correctLevel: 0, //纠错等级  
                    background: "#ffffff", //背景颜色  
                    foreground: "#000000" //前景颜色  
                });
                // style.transform = "scale("+ lxl +")";  
            });
        });
    }
</script>